cmake_minimum_required(VERSION 2.8.9)

project(well_check)

set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)

find_package(Qt5Widgets)

include_directories(${Qt5Widgets_INCLUDE_DIRS})

add_executable(WellCheck 
	main.cpp 
	LoginUI.cpp DashboardUI.cpp 
	login.ui dashboard.ui
)

qt5_use_modules(WellCheck LINK_PUBLIC Widgets)

qt5_wrap_ui(ui_login.h login.ui)
qt5_wrap_ui(ui_dashboard.h dashboard.ui)

get_target_property(QtWidgets_location Qt5::Widgets LOCATION)
get_target_property(QtCore_location Qt5::Core LOCATION)
get_target_property(QtGui_location Qt5::Gui LOCATION)

add_custom_command(TARGET WellCheck POST_BUILD
	COMMAND ${CMAKE_COMMAND} - E copy_if_different
		${QtWidgets_location} $<TARGET_FILE_DIR:WellCheck>)
add_custom_command(TARGET WellCheck POST_BUILD
	COMMAND ${CMAKE_COMMAND} - E copy_if_different
		${QtCore_location} $<TARGET_FILE_DIR:WellCheck>)
add_custom_command(TARGET WellCheck POST_BUILD
	COMMAND ${CMAKE_COMMAND} - E copy_if_different
		${QtGui_location} $<TARGET_FILE_DIR:WellCheck>)

		
